<?php
class YiichenkuoUserIdentity extends CUserIdentity
{
	public function authenticate()
	{
		$criteria=new CDbCriteria();
		$criteria->select='userid,username,userpassword';
		$criteria->addCondition(array('username=:username','userpassword=:userpassword'));
		$criteria->params=array(':username'=>$this->username,':userpassword'=>$this->password);
		$User=User::model()->find($criteria);
		if($User==null)
			return 0;
		else
			return 1;
		
	}
}